﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditRequest.aspx.cs" Inherits="FundRaising.GUI.EditRequest" MasterPageFile="~/GUI/FundRaisingMasterPage.Master" %>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <div>
        <table align="center" style="width: 780px;" bgcolor="White">
            <tr>
                <td valign="top">
                <div style="background-image: url('pic/searchbg.png'); background-repeat: no-repeat; height: 43px;" 
                        dir="rtl"> 
                        <div style="float: right; width: 30px; height: 48px;"></div>
<div style="float: right; height: 52px; width: 732px;">
    <table style="width: 100%; height: 46px;">
        <tr>
            <td style="height: 17px; text-decoration: underline; color: #FF0000;">
                <b><i>חיפוש בקשה </i></b>
            </td>
            <td style="height: 17px">
            </td>
            <td style="height: 17px; font-family: David; font-size: x-large; color: #990000;">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ניהול בקשות<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                    SelectCommand="SELECT DISTINCT [ProjectFld] FROM [Request]">
                </asp:SqlDataSource>
            </td>
            <td style="height: 17px">
                <asp:Button ID="Button6" runat="server" onclick="Button6_Click" 
                    Text="הוספת בקשה חדשה" />
            </td>
            <td style="height: 17px">
                &nbsp;</td>
            <td style="height: 17px">
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
  </div>
 
                    
                    </div>
                <div style="height: 1px" dir="rtl">
                
                </div>
                <div style="background-image: url('pic/NewMainWindow/MainWindow4.png'); background-repeat: no-repeat; height: 170px;" 
                        dir="rtl">
                     <div style="float: right; width: 33px; height: 145px;"></div>
                      <div style="float: right; height: 133px; width: 737px;">
                          <table style="width: 100%; height: 187px;">
                              <tr>
                                  <td style="text-decoration: underline">
                                      שנה</td>
                                  <td style="text-decoration: underline">
                                      קרן</td>
                                  <td style="text-decoration: underline">
                                      עמותה</td>
                                  <td style="text-decoration: underline">
                                      סטטוס</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                              </tr>
                              <tr>
                                  <td>
                                         <asp:DropDownList ID="YearDDL" runat="server" Height="22px" Width="90px" 
                                             AutoPostBack="True" DataSourceID="SqlDataSource7" DataTextField="RYear" 
                                             DataValueField="RYear">
                                         </asp:DropDownList>
                                     </td>
                                  <td>
                                         <asp:DropDownList ID="FundDDL" runat="server" 
                                             DataSourceID="SqlDataSource1" DataTextField="FundName" 
                                             DataValueField="FundName" Height="22px" Width="128px" AutoPostBack="True" 
                                             onselectedindexchanged="FundDDL_SelectedIndexChanged">
                                              
                                         </asp:DropDownList>
                                         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                          ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                                          SelectCommand="SELECT DISTINCT [FundName] FROM [Request]">
                                      </asp:SqlDataSource>
                                  </td>
                                  <td>
                                         <asp:DropDownList ID="AssoDDL" runat="server" 
                                             DataSourceID="SqlDataSource2" DataTextField="AssoName" 
                                             DataValueField="AssoName" Height="22px" Width="128px" AutoPostBack="True" 
                                             onselectedindexchanged="AssoDDL_SelectedIndexChanged">
                                         </asp:DropDownList>
                                         </td>
                                  <td>
                                      <asp:DropDownList ID="StatusDDL" runat="server" DataSourceID="SqlDataSource6" 
                                          DataTextField="RStatus" DataValueField="RStatus" Height="22px" 
                                          Width="128px" AutoPostBack="True">
                                      </asp:DropDownList>
                                      <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                                          ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                                          SelectCommand="SELECT DISTINCT [RStatus] FROM [Request]">
                                      </asp:SqlDataSource>
                                  </td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                              </tr>
                              <tr>
                                  <td style="text-decoration: underline">
                                      פרויקט</td>
                                  <td style="text-decoration: underline">
                                      תת - פרויקט</td>
                                  <td style="text-decoration: underline">
                                      תחום פעילות</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                              </tr>
                              <tr>
                                  <td>
                                         <asp:DropDownList ID="ProjDDL" runat="server" Height="22px" Width="128px" 
                                             AutoPostBack="True" onselectedindexchanged="ProjDDL_SelectedIndexChanged">
                                         </asp:DropDownList>
                                         </td>
                                  <td>
                                      <asp:DropDownList ID="SubDDL" runat="server" DataSourceID="ObjectDataSource4" 
                                          DataTextField="SubProj" DataValueField="SubProj" Height="22px" 
                                          Width="128px" AutoPostBack="True">
                                      </asp:DropDownList>
                                  </td>
                                  <td>
                                      <asp:DropDownList ID="DomainDDL" runat="server" Height="22px" 
                                          Width="128px" AutoPostBack="True" 
                                          onselectedindexchanged="DomainDDL_SelectedIndexChanged">
                                      </asp:DropDownList>
                                  </td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                              </tr>
                              <tr>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                                  <td>
                                      &nbsp;</td>
                              </tr>
                          </table>
                          </div>
                    </div>
                
                <div style="background-image: url('pic/mainContainerBg.png'); background-repeat: no-repeat; height: 404px;">
         <div style="float: right; width: 39px; height: 387px;"></div>
                <div style="background-repeat: no-repeat; height: 250px; height:391px;" 
                        dir="rtl">
                    
                
                    <table dir="rtl" style="width:100%;">
                        <tr>
                            <td>
                                <asp:ObjectDataSource ID="ObjectDataSource1" 
                        runat="server" OldValuesParameterFormatString="original_{0}" 
                        SelectMethod="SearchRequest" TypeName="FundRaising.BLL.RequestBLL">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="AssoDDL" DefaultValue="" Name="AssoName" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="FundDDL" DefaultValue="" Name="FundName" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="ProjDDL" DefaultValue="" Name="ProjectFld" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="YearDDL" DefaultValue="" Name="RYear" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="DomainDDL" DefaultValue="" Name="ActivetyFLD" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="SubDDL" DefaultValue="" Name="SubProj" 
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="StatusDDL" DefaultValue="" Name="RStatus" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                            </td>
                            <td style="width: 166px">
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                        SelectCommand="SELECT DISTINCT [AssoName] FROM [Request]">
                    </asp:SqlDataSource>
                            </td>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="text-decoration: underline; color: #FF0000; height: 7px;" 
                                colspan="2">
                                <i>&nbsp;&nbsp; בחר בקשה לעריכה</i></td>
                            <td style="height: 7px">
                                </td>
                            <td style="height: 7px">
                                </td>
                        </tr>
                        <tr>
                            <td colspan="3" dir="rtl" rowspan="2">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:GridView ID="GridView2" runat="server" AllowSorting="True" 
                                    AutoGenerateColumns="False" CellPadding="2" DataKeyNames="RequestKey" 
                                    DataSourceID="ObjectDataSource1" ForeColor="Black" GridLines="None" 
                                    AllowPaging="True" CaptionAlign="Top" 
                                    onselectedindexchanged="GridView2_SelectedIndexChanged1" Width="635px" 
                                    BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px">
                                    <Columns>
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                    CommandName="Select" onclick="LinkButton1_Click" Text="בחר"></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="RYear" HeaderText="שנה" SortExpression="RYear" />
                                        <asp:BoundField DataField="FundName" HeaderText=" קרן" 
                                            SortExpression="FundName" />
                                        <asp:BoundField DataField="AssoName" HeaderText=" עמותה" 
                                            SortExpression="AssoName" />
                                        <asp:BoundField DataField="RStatus" HeaderText="סטטוס" 
                                            SortExpression="RStatus" />
                                        <asp:BoundField DataField="ProjectFld" HeaderText="פרויקט" 
                                            SortExpression="ProjectFld" />
                                        <asp:BoundField DataField="SubProj" HeaderText="תת - פרויקט" 
                                            SortExpression="SubProj" />
                                        <asp:BoundField DataField="ActivetyFLD" HeaderText="תחום פעילות" 
                                            SortExpression="ActivetyFLD" />
                                        <asp:BoundField DataField="ForWhat" HeaderText="עבור מה" 
                                            SortExpression="ForWhat" Visible="False" />
                                        <asp:BoundField DataField="SubmiMethod" HeaderText="איך הוגש" 
                                            SortExpression="SubmiMethod" Visible="False" />
                                        <asp:BoundField DataField="MoneyRequested" HeaderText="סכום מבוקש" 
                                            SortExpression="MoneyRequested" Visible="False" />
                                        <asp:BoundField DataField="MoneyExpected" HeaderText="סכום משוער" 
                                            SortExpression="MoneyExpected" Visible="False" />
                                        <asp:BoundField DataField="DateExpected" HeaderText="תאריך משוער" 
                                            SortExpression="DateExpected" Visible="False" />
                                        <asp:BoundField DataField="RequestKey" HeaderText="RequestKey" ReadOnly="True" 
                                            SortExpression="RequestKey" Visible="False" />
                                        <asp:BoundField DataField="RequestSntDate" HeaderText="תאריך שליחה" 
                                            SortExpression="RequestSntDate" Visible="False" />
                                    </Columns>
                                    <FooterStyle BackColor="Tan" />
                                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                                        HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                </asp:GridView>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                    
                
                    <br />
                    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                        SelectCommand="SELECT * FROM [Request] WHERE ([RequestKey] = @RequestKey)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="GridView2" Name="RequestKey" 
                                PropertyName="SelectedValue" Type="Object" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
                        SelectMethod="getdata" TypeName="FundRaising.BLL.RequestBLL">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="FundDDL" Name="FundName" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                        SelectCommand="SELECT DISTINCT * FROM [Request] WHERE ([RequestKey] = @RequestKey)" 
                        UpdateCommand="UPDATE [Request] SET [RYear] = @RYear, [AssoName] = @AssoName, [ActivetyFLD] = @ActivetyFLD, [FundName] = @FundName, [ProjectFld] = @ProjectFld, [SubProj] = @SubProj, [ForWhat] = @ForWhat, [SubmiMethod] = @SubmiMethod, [MoneyRequested] = @MoneyRequested, [MoneyExpected] = @MoneyExpected, [DateExpected] = @DateExpected, [RequestKey] = @RequestKey, [RequestSntDate] = @RequestSntDate, [RStatus] = @RStatus WHERE (([RequestKey] = @Original_RequestKey))">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="GridView2" Name="RequestKey" 
                                PropertyName="SelectedValue" Type="Object" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="RYear" />
                            <asp:Parameter Name="AssoName" />
                            <asp:Parameter Name="ActivetyFLD" />
                            <asp:Parameter Name="FundName" />
                            <asp:Parameter Name="ProjectFld" />
                            <asp:Parameter Name="SubProj" />
                            <asp:Parameter Name="ForWhat" />
                            <asp:Parameter Name="SubmiMethod" />
                            <asp:Parameter Name="MoneyRequested" />
                            <asp:Parameter Name="MoneyExpected" />
                            <asp:Parameter Name="DateExpected" />
                            <asp:Parameter Name="RequestKey" />
                            <asp:Parameter Name="RequestSntDate" />
                            <asp:Parameter Name="RStatus" />
                            <asp:Parameter Name="Original_RequestKey" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                    <br />
                    <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" 
                        SelectMethod="GetSubProj" TypeName="FundRaising.BLL.RequestBLL" 
                        OldValuesParameterFormatString="original_{0}">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ProjDDL" Name="ProjectFLD" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                        SelectMethod="GetProjByAssoName" TypeName="FundRaising.BLL.RequestBLL" 
                        OldValuesParameterFormatString="original_{0}">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="AssoDDL" Name="AssoName" 
                                PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                        SelectCommand="SELECT DISTINCT [RYear] FROM [Request]"></asp:SqlDataSource>
                    
                
                </div>
                </div>
                
                
                
                </td>
                </tr>
         </table>
    </div>
        
                             

</asp:Content>

